home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig10_02.jar / Ch10 / Fig10_02 / Shape.h < prev   
C/C++ Source or Header  |  1997-10-28  |  407b  |  19 lines

  1. // Fig. 10.2: shape.h
  2. // Definition of abstract base class Shape
  3. #ifndef SHAPE_H
  4. #define SHAPE_H
  5. #include <iostream.h>
  6.  
  7. class Shape {
  8. public:
  9.    virtual double area() const { return 0.0; }
  10.    virtual double volume() const { return 0.0; }
  11.  
  12.    // pure virtual functions overridden in derived classes
  13.    virtual void printShapeName() const = 0;
  14.    virtual void print() const = 0;
  15. };
  16.  
  17. #endif
  18.  
  19.